package com.freelancer.musicinstruction.activity;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

import com.freelancer.musicinstruction.R;
import com.freelancer.musicinstruction.activity.interfaces.ServiceInvokable;

public class SearchResults extends TabActivity implements ServiceInvokable {
	
	private static final String TAG = SearchResults.class.getSimpleName();
	
	TabHost mTabHost;
	

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		initTabHost( );
		
	}

	private void initTabHost() {

		mTabHost = getTabHost();

		mTabHost.addTab(mTabHost.newTabSpec("YouTube_Tab").setIndicator(null,
				getResources().getDrawable(R.drawable.ic_menu_youtube_startscreen ))
				.setContent( new Intent ( SearchResults.this, YoutubeList.class ).putExtras( this.getIntent().getExtras() ) ));
		mTabHost.addTab(mTabHost.newTabSpec("911Tabs_Tab").setIndicator(null, 
				getResources().getDrawable( R.drawable.tablature )).setContent( new Intent( SearchResults.this, NineElevenList.class ) ));
		mTabHost.addTab(mTabHost.newTabSpec("Saved_Instructions").setIndicator(null, 
				getResources().getDrawable( R.drawable.ic_menu_save)).setContent( new Intent( SearchResults.this, NineElevenList.class ) ));

		mTabHost.setCurrentTab(0);
		
	}

	/*@Override
	public View createTabContent(String index) {

		LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		
			if ( index.equalsIgnoreCase( "YouTube_Tab" ) ) {
				

				youtubeListView = (ListView)((LinearLayout) inflater.inflate( R.layout.youtube_list, null )).getChildAt( 0 );
				video_adapter = new YoutubeVideoAdapter(this, R.layout.youtube_listitem, videos ) ;
				youtubeListView.setAdapter( video_adapter );
				registerForContextMenu(youtubeListView);
				return youtubeListView;
			
			} else if (index.equalsIgnoreCase( "911Tabs_Tab" ) ) {
				nineelevenListView = (ListView)((LinearLayout) inflater.inflate( R.layout.nineeleven_list, null) ).getChildAt( 0 );
				nineelevenListView.setAdapter(new YoutubeVideoAdapter(this, R.layout.youtube_listitem, videos ) );
				registerForContextMenu(nineelevenListView);
				return nineelevenListView;
			}
		
		
		return null;
	}*/

	@Override
	public void onServiceCallFailed() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onServiceCallFailedAborted() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onServiceCallFailedNoNetwork() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onLoadingComplete() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onLoadingInterrupted() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onLoadingStarting() {
		// TODO Auto-generated method stub
		
	}
}
